package com.exthirteen.textgamescript.controller;

import com.exthirteen.textgamescript.model.dto.CallbackDTO;
import com.exthirteen.textgamescript.model.vo.Result;
import com.exthirteen.textgamescript.service.AuthConfigService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 设备配置相关对外接口
 * </p>
 *
 * @author exthirteen
 * @since 2025/3/4
 */
@CrossOrigin
@RestController
@RequestMapping("/tools")
public class AuthConfigApiController {

    @Resource
    private AuthConfigService authConfigService;

    /**
     * 获取自己的设备配置信息
     */
    @RequestMapping("/setCallback")
    public Result<?> setCallback(@RequestBody CallbackDTO param) {
        authConfigService.setCallback(param.getCallbackUrl());
        return Result.success();
    }
}
